<%--
  Created by IntelliJ IDEA.
  User: asus
  Date: 2023/4/24
  Time: 10:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title></title>
    <link href="CSS/Style1.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="Scripts/jquery-3.1.1.js"></script>
    <script>
        $(function () {
            $("[name='deleteur']").click(function () {
                let thisa = $(this);
                let id = $(this).prop("id");
                $.ajax({
                    url:'delteurByrid?id='+id,
                    success:function (data) {
                        if(data==1){//删除成功
                            thisa.parent().parent().parent().remove();
                        }
                    }
                })
            })
        })
    </script>
</head>
<body>
<div id="desDiv">
    <span>角色管理</span>
</div>
<div id="dataDiv">
    <div id="headDiv">
        <img src="images/22.gif" />&nbsp;&nbsp;<a href="page_Manager/page_AddRole">新建</a>
    </div>
    <table class="dataTable" style="text-align: center">
        <tr>
            <th>角色ID</th>
            <th>角色名称</th>
            <th>操作</th>
        </tr>
        <c:forEach items="${rolesList}" var="role">
        <tr>
            <td>${role.rid}</td>
            <td>${role.rname}</td>
            <td><a href="#"><img title="修改" src="images/edt.gif" style="border:0px"/></a><a><img title="删除" src="images/del.gif" name="deleteur" id="${role.rid}" /></a></td>
        </tr>
        </c:forEach>
    </table>
</div>
</body>
</html>
